from django.db import models

from apps.baseData.models import BaseModel, User
from apps.need.models import Need


class Report(BaseModel):
    content = models.TextField(verbose_name="举报内容")
    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="举报的用户")
    need = models.ForeignKey(Need, on_delete=models.CASCADE, verbose_name="举报的帖子")

    class Meta:
        db_table = 'report'
        verbose_name = "举报表"
        verbose_name_plural = verbose_name


class ReportImage(BaseModel):
    url = models.URLField(verbose_name="图片的链接")

    class Meta:
        db_table = 'report_image'
        verbose_name = "举报表"
        verbose_name_plural = verbose_name


class ReportTempImage(BaseModel):
    filename = models.CharField(max_length=255, verbose_name="图片名字")
    url = models.URLField(verbose_name="图片的链接")
    bucket = models.CharField(max_length=255, verbose_name="aliyun的bucket")
    request_id = models.CharField(max_length=255, verbose_name="aliyun的返回值id")
    out_time = models.DateTimeField(auto_now=True)

    class Meta:
        db_table = 'report_Temp_image'
        verbose_name = "举报表"
        verbose_name_plural = verbose_name
